﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SearchBox.ascx.cs" Inherits="SearchBox" %>

    <strong><asp:Label ID="p000" runat="server" /></strong>
    <table class="tbl_search">
        <tr>
            <td>
                <asp:Label ID="p001" runat="server" /></td><td>
                <asp:DropDownList ID="ddl_Country" Width="350" onchange="ChangeRegion(this);" runat="server" />
            </td>
        </tr>    
        <tr>
            <td>
                <asp:Label ID="p002" runat="server" /></td><td>
                <asp:DropDownList ID="ddl_Gerion_France" Width="350" runat="server" >
                    <asp:ListItem Value="0" Text="Париж и окрестности" />
                    <asp:ListItem Value="1" Text="Лазурный берег" />
                    <asp:ListItem Value="2" Text="Альпы" />
                    <asp:ListItem Value="3" Text="Нормандия" />
                    <asp:ListItem Value="4" Text="Бретань" />
                </asp:DropDownList>
                <asp:DropDownList ID="ddl_Region_Spain" Width="350" style="display: none;" runat="server" >
                    <asp:ListItem Value="5" Text="Барселона" />
                    <asp:ListItem Value="6" Text="Коста Брава" />
                    <asp:ListItem Value="7" Text="Коста Бланка" />
                </asp:DropDownList>
                <asp:DropDownList ID="ddl_Region_Shveden" Width="350" style="display: none;" runat="server" >
                    <asp:ListItem Value="8" Text="Женева" />
                    <asp:ListItem Value="9" Text="Лазурный берег" />
                    <asp:ListItem Value="10" Text="Цюрих" />
                </asp:DropDownList>
                <asp:DropDownList ID="ddl_Region_USA" Width="350" style="display: none;" runat="server" >
                    <asp:ListItem Value="11" Text="Майями" />
                    <asp:ListItem Value="12" Text="Гаваи" />
                </asp:DropDownList>                                               
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="p003" runat="server" /></td><td>
                <asp:DropDownList ID="ddl_ObjectType" Width="350" runat="server" />
            </td>
        </tr>
        <tr>
            <td><asp:Label ID="p004" runat="server" /></td><td>
                <asp:DropDownList ID="ddl_Square" Width="350" runat="server">
                    <asp:ListItem Value="0" Text="less 100 m2" />
                    <asp:ListItem Value="1" Text="from 100 to 300 m2" />
                    <asp:ListItem Value="2" Text="from 300 to 500 m2" />
                    <asp:ListItem Value="3" Text="more 500 m2" />
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td><asp:Label ID="p005" runat="server" /></td><td>
                <asp:TextBox ID="tb_Price1" Width="150" runat="server" />
                <asp:TextBox ID="tb_Price2" Width="150" runat="server" />
                <asp:DropDownList ID="ddl_Currency" Width="44" runat="server">
                    <asp:ListItem Value="0" Text="EUR" />
                    <asp:ListItem Value="1" Text="UAH" />
                    <asp:ListItem Value="2" Text="USD" />
                </asp:DropDownList>
            </td>
        </tr>  
        <tr>
            <td></td>
            <td>
                <asp:LinkButton ID="btn_Search" Text="Искать" runat="server" Font-Bold="true" />
            </td>
        </tr>               
    </table>
    
    <script language="javascript">
        function ChangeRegion(sender)
        {       
            var _ddl_Gerion_France = document.getElementById('ctl00_SearchBox1_ddl_Gerion_France');
            var _ddl_Region_Spain = document.getElementById('ctl00_SearchBox1_ddl_Region_Spain');
            var _ddl_Region_Shveden = document.getElementById('ctl00_SearchBox1_ddl_Region_Shveden');
            var _ddl_Region_USA = document.getElementById('ctl00_SearchBox1_ddl_Region_USA');
            
            _ddl_Gerion_France.style.display = "none"; _ddl_Region_Spain.style.display = "none";
            _ddl_Region_Shveden.style.display = "none"; _ddl_Region_USA.style.display = "none";
            
            
            switch(sender.value)
            {
                case "1": _ddl_Gerion_France.style.display = ""; break;
                case "2": _ddl_Region_USA.style.display = ""; break;
                case "3": _ddl_Region_Spain.style.display = ""; break;
                case "4": _ddl_Region_Shveden.style.display = ""; break;
            }
        }    
    </script>
    


